package com.wormhole.wormholemanagement.entity;

import com.wormhole.wormholemanagement.utils.JsonConverter;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
@Entity
@Table(name = "medical_insurance_records", indexes = {
        @Index(name = "idx_document_number", columnList = "document_number"),
        @Index(name = "idx_id_card", columnList = "id_card"),
        @Index(name = "idx_box_number", columnList = "box_number"),
        @Index(name = "idx_item_number", columnList = "item_number"),
        @Index(name = "idx_operator_id", columnList = "operator_id")
})

public class MedicalInsuranceRecord {
    // Getters and Setters
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "record_id")
    private Long recordId;

    private String title;
    private String documentNumber;
    private String creationDate;
    private String socialSecurityCode;
    private String socialSecurityUnit;
    private String name;
    private String idCard;
    private String responsibleParty;
    private String boxNumber;
    private String itemNumber;
    private String pageNumber;
    private String township;
    private String hospital;
    private Long operatorId;
    private String createdAt;
    private String updatedAt;

    @Convert(converter = JsonConverter.class)
    @Column(columnDefinition = "json")
    private String extendedData;

}